#pragma once
#include<iostream>
#include<ctime>
#include<cstdio>
#define NORMAL 1
#define WARING 2
#define ERROR 3
#define FATAL 4

#define log_message(degree, format, ...) do {\
    if (degree <= NORMAL) break;\
    time_t now_time = time(NULL);\
    struct tm* cur_time = localtime(&now_time);\
    char display_time[64] = {0};\
    strftime(display_time, 63, "%Y:%m:%d %H:%M:%S", cur_time);\
    fprintf(stdout,"[TIME: %s  AERA: %s: %d] " format "\n", display_time, __FILE__, __LINE__, ##__VA_ARGS__);\
}while(0)

